﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Page 
Language="C#" 
AutoEventWireup="true" 
CodeBehind="GoodsReturn.aspx.cs" 
Inherits="KoPages.Layouts.KoPages.Report.GoodsReturn" 
DynamicMasterPageFile="~masterurl/default.master" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
</asp:Content>

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">

<!--
Company Data Source 
-->
<asp:SqlDataSource 
		runat="server" 
		ConnectionString="<%$ ConnectionStrings:DB04Connect %>"
		SelectCommand="SELECT DISTINCT Kontragent FROM dbo.vw_1C_Get_Returns ORDER BY Kontragent"
		ID="SqlDS_Company" 
		ProviderName="System.Data.OleDb" >
</asp:SqlDataSource>

<!--
Sklad Data Source
-->
<asp:SqlDataSource 
		runat="server" 
		ConnectionString="<%$ ConnectionStrings:DB04Connect %>"
		SelectCommand="SELECT DISTINCT Sklad FROM dbo.vw_1C_Get_Returns ORDER BY Sklad"
		ID="SqlDS_Sklad" 
		ProviderName="System.Data.OleDb" >
</asp:SqlDataSource>

<!--
Main Data
Returns DataSource
-->
<asp:SqlDataSource 
	runat="server" 
	ConnectionString="<%$ ConnectionStrings:DB04Connect %>"
	SelectCommand=""
	ID="SqlDS" 
	ProviderName="<%$ ConnectionStrings:DB04Connect.ProviderName %>" >
</asp:SqlDataSource>


<!-- -----------------------------------------------------------
Controls
-->
<table style="width: 100%">
<tr>
    <td style="width: 5px">
        <span lang="ru"><br /><br /></span>
    </td>
    <td style="width: 91px">
<table style="width: 187%">
<tr>
    <td style="width: 88px"><span lang="ru">Контрагент -</span></td>
    <td>
        <asp:DropDownList runat="server" id="Company" AutoPostBack="True" Width="200px" 
            DataSourceID="SqlDS_Company" DataValueField="Kontragent" 
            DataTextField="Kontragent" onprerender="Company_PreRender"
            onselectedindexchanged="Company_SelectedIndexChanged" >
        </asp:DropDownList>
    </td>
</tr>
<tr>
    <td style="width: 88px"><span lang="ru">Склад-</span></td>
    <td>
        <asp:DropDownList runat="server" id="Sklad" AutoPostBack="True" Width="200px" 
            DataSourceID="SqlDS_Sklad" DataValueField="Sklad" DataTextField="Sklad" 
            onprerender="Sklad_PreRender" onselectedindexchanged="Sklad_SelectedIndexChanged">
        </asp:DropDownList>
    </td>
</tr>
</table>
</td>
<td style="width: 8px">&nbsp;</td>
<td style="width: 8px">&nbsp;</td>
    <td style="width: 47px">
    <span lang="ru">Дата с </span>
    <span lang="en-us">:</span></td>
    <td style="width: 16px">
	    <SharePoint:DateTimeControl 
            runat="server" 
            id="dtFrom" 
            DateOnly="True" 
            AutoPostBack="True"
            OnDateChanged="dtFrom_SelectionChanged"
            />
    </td>
    <td style="width: 32px">
        <span lang="ru">&nbsp; по </span>
        <span lang="en-us">:</span></td>
    <td style="width: 16px">
	    <SharePoint:DateTimeControl 
            runat="server" 
            id="dtTo" 
            DateOnly="True" 
            AutoPostBack="True"
            OnDateChanged="dtTo_SelectionChanged"
            />
    </td>
    <td>&nbsp;</td>
</tr>
</table>


<!-- -------------------------------------------------
    GridView
-->
<asp:GridView 
    ID="GW" runat="server" 
    AutoGenerateColumns="False" CellPadding="4" 
    DataSourceID="SqlDS" EnableModelValidation="True" ForeColor="#333333" 
    GridLines="None" PageSize="20"  Width="100%">
    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
    <Columns>
        <asp:CommandField HeaderText="Выбрать" SelectText="Выбрать" 
            ShowSelectButton="True" />
        <asp:BoundField DataField="DT" HeaderText="Дата" ReadOnly="True" 
            SortExpression="DT" />
        <asp:BoundField DataField="Sklad" HeaderText="Склад" ReadOnly="True" 
            SortExpression="Sklad" />
        <asp:BoundField DataField="Kontragent" HeaderText="Контрагент" ReadOnly="True" 
            SortExpression="Kontragent" />
        <asp:BoundField DataField="_Number" HeaderText="Номер" ReadOnly="True" 
            SortExpression="_Number" />
        <asp:BoundField DataField="Sum" HeaderText="Сумма" ReadOnly="True" 
            SortExpression="Sum" />
    </Columns>
    <EditRowStyle BackColor="#999999" />
    <EmptyDataTemplate>
        <p class="MsoNormal">
            Запрос не вернул данных<p></p>
        </p>
    </EmptyDataTemplate>
    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
</asp:GridView>

<br />
<asp:HiddenField runat="server" id="hfCompany" Value="Арвачев А.В. (Р)"/>
<asp:HiddenField runat="server" id="hfSklad"/>
<asp:HiddenField runat="server" id="hfDateFrom" Value="2011-06-16" />
<asp:HiddenField runat="server" id="hfDateTo"  Value="2011-12-30" />
<br />

</asp:Content>

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
Реестр возвратов
</asp:Content>

<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
Goods Returns (Реестр возвратов)
</asp:Content>




